﻿#ifndef MEDIACAPTURE_H
#define MEDIACAPTURE_H

#include <QThread>
#include "mediaoutput.h"
#include "rtmppusher.h"

class MediaCapture : public QThread
{
    Q_OBJECT
public:
    MediaCapture();
    ~MediaCapture();

    void setRunState(bool start);

    //avPacket传递至推流线程 type为音视频类型
    void sendAVPacketToPusher(RtmpPusher *pusher, AVPacket *packet, AVPacketType type, uint32_t pts, uint32_t dts);

protected:
    void run();

public:
    volatile bool isRun;
    QString filePath;

    AudioOutput *audioOutput;
    VideoOutput *videoOutput;

    RtmpPusher pusher;
};

#endif // MEDIACAPTURE_H
